﻿namespace Arms.Persistence.Mappings
{
    using Arms.Domain;
    using System;
    using System.Data.Entity.ModelConfiguration;

    internal class EntityDescribedMap<T> : EntityMap<T> where T : EntityDescribed
    {
        public EntityDescribedMap()
            : base()
        {
            Property(x => x.Name).IsRequired().HasColumnName(typeof(T).Name + "Name").IsMaxLength().HasColumnOrder(2);
            Property(x => x.Description).HasColumnName(typeof(T).Name + "Description").IsMaxLength().HasColumnOrder(3);
            Property(x => x.Comment).HasColumnName(typeof(T).Name + "Comment").IsMaxLength().HasColumnOrder(4);
        }
    }
}
